package com.aiyige.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhuyakun on 2017/12/19.
 */

public class SysDataDict implements Parcelable {
    Long id;
    String dictCode;
    String dictId;
    String dictName;
    Integer sortNo;
    String status;

    private SysDataDict(Builder builder) {
        setId(builder.id);
        setDictCode(builder.dictCode);
        setDictId(builder.dictId);
        setDictName(builder.dictName);
        setSortNo(builder.sortNo);
        setStatus(builder.status);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDictCode() {
        return dictCode;
    }

    public void setDictCode(String dictCode) {
        this.dictCode = dictCode;
    }

    public String getDictId() {
        return dictId;
    }

    public void setDictId(String dictId) {
        this.dictId = dictId;
    }

    public String getDictName() {
        return dictName;
    }

    public void setDictName(String dictName) {
        this.dictName = dictName;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    public static final class Builder {
        private Long id;
        private String dictCode;
        private String dictId;
        private String dictName;
        private Integer sortNo;
        private String status;

        private Builder() {
        }

        public Builder id(Long id) {
            this.id = id;
            return this;
        }

        public Builder dictCode(String dictCode) {
            this.dictCode = dictCode;
            return this;
        }

        public Builder dictId(String dictId) {
            this.dictId = dictId;
            return this;
        }

        public Builder dictName(String dictName) {
            this.dictName = dictName;
            return this;
        }

        public Builder sortNo(Integer sortNo) {
            this.sortNo = sortNo;
            return this;
        }

        public Builder status(String status) {
            this.status = status;
            return this;
        }

        public SysDataDict build() {
            return new SysDataDict(this);
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.dictCode);
        dest.writeString(this.dictId);
        dest.writeString(this.dictName);
        dest.writeValue(this.sortNo);
        dest.writeString(this.status);
    }

    protected SysDataDict(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.dictCode = in.readString();
        this.dictId = in.readString();
        this.dictName = in.readString();
        this.sortNo = (Integer) in.readValue(Integer.class.getClassLoader());
        this.status = in.readString();
    }

    public static final Parcelable.Creator<SysDataDict> CREATOR = new Parcelable.Creator<SysDataDict>() {
        @Override
        public SysDataDict createFromParcel(Parcel source) {
            return new SysDataDict(source);
        }

        @Override
        public SysDataDict[] newArray(int size) {
            return new SysDataDict[size];
        }
    };
}
